home *** CD-ROM | disk | FTP | other *** search
-
- /* _Setloc function */
- #include <ctype.h>
- #include <limits.h>
- #include <locale.h>
- #include <stdlib.h>
- #include <string.h>
-
- /* set category for locale */
- struct lconv *_Setloc(int cat, struct lconv *p)
- {
- switch (cat)
- { /* set a category */
- case LC_COLLATE:
- break;
- case LC_CTYPE:
- _Ctype = p->_Ctype;
- _Tolower = p->_Tolower;
- _Toupper = p->_Toupper;
- break;
- case LC_MONETARY:
- _Locale.currency_symbol = p->currency_symbol;
- _Locale.int_curr_symbol = p->int_curr_symbol;
- _Locale.mon_decimal_point = p->mon_decimal_point;
- _Locale.mon_grouping = p->mon_grouping;
- _Locale.mon_thousands_sep = p->mon_thousands_sep;
- _Locale.negative_sign = p->negative_sign;
- _Locale.positive_sign = p->positive_sign;
- _Locale.frac_digits = p->frac_digits;
- _Locale.int_frac_digits = p->int_frac_digits;
- _Locale.n_cs_precedes = p->n_cs_precedes;
- _Locale.n_sep_by_space = p->n_sep_by_space;
- _Locale.n_sign_posn = p->n_sign_posn;
- _Locale.p_cs_precedes = p->p_cs_precedes;
- _Locale.p_sep_by_space = p->p_sep_by_space;
- _Locale.p_sign_posn = p->p_sign_posn;
- break;
- case LC_NUMERIC:
- _Locale.decimal_point = p->decimal_point[0] != '\0'
- ? p->decimal_point : ".";
- _Locale.grouping = p->grouping;
- _Locale.thousands_sep = p->thousands_sep;
- break;
- case LC_TIME:
- break;
- }
- return (p);
- }
-
-